Add support for virtio device reset#5891
Merged
Merged
Conversation
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 15, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5891 +/- ##
==========================================
- Coverage 83.12% 82.88% -0.25%
==========================================
Files 277 277
Lines 30259 30441 +182
==========================================
+ Hits 25154 25230 +76
- Misses 5105 5211 +106
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Manciukic
reviewed
May 18, 2026
ShadowCurse
reviewed
May 19, 2026
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 21, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
May 26, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
bk0v
reviewed
May 27, 2026
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
Jun 8, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
Jun 8, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
Jun 9, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
bk0v
reviewed
Jun 10, 2026
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
Jun 10, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Implement the _reset() method for the virtio-net device, resetting the net specific state in-place. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-net device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional and MMDS is still reachable. Suggested-by: Adam Jensen <adam@acj.sh> Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ilstam
added a commit
to ilstam/firecracker
that referenced
this pull request
Jul 3, 2026
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Manciukic
previously approved these changes
Jul 3, 2026
ShadowCurse
reviewed
Jul 3, 2026
Implement the _reset() method for the virtio-block device, resetting the device-specific state in-place. For the async io_uring engine drain the ring so that any in-flight operations complete. Adjust the seccomp filter such that vCPU threads can call io_uring_enter. This only adds support for the Virtio backend for now and not VhostUser. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-block device reset works end-to-end by unbinding and rebinding the guest driver for a scratch block device and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Pmem does not have any backend specific state that needs resetting so implement the _reset() method by simply returning true. The rest of the state is handled by the generic reset(). Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-pmem device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Implement the _reset() method for the virtio-balloon device, resetting the balloon specific state in-place. Do not deflate the balloon on reset. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-balloon device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
The entropy device does not have any backend specific state that needs resetting so implement the _reset() method by simply returning true. The test_failed_reset_blocks_reinitialization() test used an entropy device assuming it doesn't support reset. Since it now does, adjust the test to check that the device is first deactivated after a reset and then the driver can perform the initialization sequence again. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-rng device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Register the muxer's host socket epoll listener when the device is activated rather than when the muxer is constructed, by adding an activate() method to the VsockBackend trait and calling it from Vsock::activate(). This ties the listener's lifetime to device activation instead of muxer construction. This lays the groundwork for device reset, which needs the listener set to be re-established on each activation. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Implement the _reset() method for the virtio-vsock device, resetting the vsock specific state in-place. Add epoll_ctl to the vCPU seccomp filter, since it's needed to remove the vsock muxer's connection and listener epoll listeners when the device is reset. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-vsock device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
The virtio-mem device does not have any backend specific state that needs resetting so implement the _reset() method by simply returning true. Plugged memory regions remain intact. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
Add a test that verifies virtio-mem device reset works end-to-end by unbinding and rebinding the guest driver and checking the device remains functional. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
firecracker-microvm#5891 Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
ShadowCurse
approved these changes
Jul 3, 2026
Manciukic
approved these changes
Jul 3, 2026
Merged
via the queue into
firecracker-microvm:main
with commit Jul 3, 2026
4027850
6 of 7 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for virtio device reset
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.